#include <cstdlib>
#include <iostream>
#include "bank.h"

using namespace std;

void English();

Bank Me;




int main(int argc, char *argv[])
{
    char Clear[] = "cls";
    char ClearL[] = "clear";
    #ifdef WINDOWS
    char *Cls = Clear;
    #else
    #ifdef LINUX
    char *Cls = ClearL;
    #endif
    #endif
    string Choice;
    srand(time(NULL));
    MainMenu:
    system(Cls);
    Me.yAd();
    cout << "Welcome to MarsBank - The first bank on Mars." << endl;
    cout << "Please Select your language:" << endl;
    cout << "(1) English" << endl;
    getChoice:
    cin >> Choice;
    if(Choice == "1")
    {
      cout << endl;
      English();
      goto MainMenu;
    }
    else if(Choice == "2")
    {
     cout << endl;
    }
    else
    {
        cout << "Wrong Selection. Please do again:";
        goto getChoice;
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}

void English()
{
     int Choice;
     system(Cls);
     ChooseSrv:
     Me.yAd();
     string backgroundImage = "background.jpg";
     cout << "What do you need?" << endl;
     cout << "(1) Open a Mars Bank account" << endl;
     cout << "(2) Deposit money" << endl;
     cout << "(3) Withdraw Money" << endl;
     cout << "(4) Check Account Balance" << endl;
     cout << "(5) Advertise with us" << endl;
     cout << "(6) Change language" <<endl;
     //cout << "(7) Debug" << endl;
     cin >> Choice;
     switch(Choice)
     {
                   case 1:
                        Me.userHandler(0,backgroundImage);
                        system(Cls);
                        goto ChooseSrv;
                        break;
                   case 2:
                        Me.userHandler(3,backgroundImage);
                        system(Cls);
                        goto ChooseSrv;
                        break;
                   case 3:
                        Me.userHandler(2,backgroundImage);
                        system(Cls);
                        goto ChooseSrv;
                        break;
                   case 4:
                        Me.userHandler(1,backgroundImage);
                        goto ChooseSrv;
                        break;
                   case 5:
                        Me.userHandler(4,backgroundImage);
                        goto ChooseSrv;
                        break;
                   case 6:
                        break; //exits the goto loop, returning to main
                   case 7:
                        exit(0);
                        break;
                   default:
                           cout << "Please try again!" << endl;
                           goto ChooseSrv;
     }
}
